﻿<%@ Page Language="C#" %>
<%@ Import Namespace= "System.Collections"%>
<%@ Import Namespace="System.Collections.Generic" %>


<% 
    List<DTO.KhuyenMaiDto> list = BUS.KhuyenMaiBus.LayDanhSachKhuyenMai();
    Response.Write("<?xml version='1.0' encoding='utf-8'?>");
    Response.Write("<root>");
    Response.Write("<total>" + list.Count + "</total>");
    Response.Write("<listkhuyenmai>");
    foreach (DTO.KhuyenMaiDto km in list)
    {
        Response.Write("<khuyenmai>");
        Response.Write("<id>" + km.ID + "</id>");
        Response.Write("<batdau><![CDATA[" + km.NgayBatDau + "]]></batdau>");
        Response.Write("<ketthuc><![CDATA[" + km.NgayKetThuc + "]]></ketthuc>");
        Response.Write("<hinhthuc>" + km.HinhThuc + "</hinhthuc>");
        Response.Write("</khuyenmai>");
    }
    Response.Write("</listkhuyenmai>");
    Response.Write("</root>");
%>